//
//  AppService.h
//  quickBatchManager
//
//  Created by 王定波 on 15/9/25.
//  Copyright © 2015年 jack. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ProductInfoModel.h"
#import "ProductModel.h"
#import "BatchProductModel.h"
#import "AddProductModel.h"
#import "NumberFieldModel.h"
#import "SaleOrderModel.h"
#import "SupplierModel.h"
#import "FactoryProductInfoModel.h"
#import "PayOutModel.h"
#import "PayInModel.h"
#import "NumberFieldView.h"
#import "ClearPriceModel.h"
#import "SaleOrderInfoModel.h"

@interface AppService : NSObject
+(BatchProductModel*) putInProduct:(NSString *)modelNo andBatch:(BatchProductModel *)batch andCategory:(CategoryModel *)category andBuyPrice:(NSString *)buyPrice andSalePrice:(NSString *)salePrice andImage:(UIImage*) image andPicPath:(NSString*)picPath andColorSizeView:(NumberFieldView *)colorSizeView;
+(void)overBatchProduct:(BatchProductModel*)batch;
//获取批号
+(BatchProductModel *)getBatchProductByDate:(NSDate*)date;
+(BatchProductModel *)getBatchProductByNo:(NSString*)batchNo;
+(SupplierModel*)getSupplyByBatchNo:(NSString*)batchNo;

//获取订单号
+(SaleOrderModel *)getNewSaleOrder;

//开单
+(void) putInSaleProduct:(SaleOrderModel *)saleOrder andProductId:(NSInteger) productId andBuyPrice:(NSString *)buyPrice andColorList:(NSArray*)colorList  andSizeList:(NSArray*)sizeList andNumberList:(NSDictionary*) selectNumber andSalePrices:(NSString *) salePrices;
//更新订单数
+(void)updateSaleProductInfo:(NSInteger)saleOrderId andProductId:(NSInteger) productId andPductInfoId:(NSInteger) productInfoId andNumberList:(NSDictionary*) selectNumber andColorList:(NSArray*)colorList  andSizeList:(NSArray*)sizeList andSalePrices:(NSString *) salePrices;
//工厂订单
+(void) putInFactoryProduct:(NSInteger)productId andColorList:(NSArray*)colorList  andSizeList:(NSArray*)sizeList andNumberList:(NSDictionary*) selectNumber;

+(NSArray*)searchProductByKeyWord:(NSString*)keyword;
+(NSDictionary*)getSizeAndColorByModel:(NSString*)model;
+(NSArray*)getProductNumListById:(NSInteger)productId andColorList:(NSArray*)colorList  andSizeList:(NSArray*)sizeList;

//获取该时间前用户的余额
+(double)getSupplierTotalNumberById:(NSInteger)supplierId;

+(double)getAmountByUserIdAndType:(NSInteger)userId andType:(AccountType) accountType;
+(double)getAmountByUserIdAndDateAndType:(NSInteger)userId  andDate:(NSString*)date andType:(AccountType) accountType;


//获取批次列表
+(NSArray*)getBatchListById:(NSInteger)supplierId  andStartDate:(NSString*)startdate andEndDate:(NSString*)enddate;
+(NSArray*)getPayOutListById:(NSInteger)supplierId  andStartDate:(NSString*)startdate andEndDate:(NSString*)enddate;
+(NSArray*)getPayInListById:(NSInteger)clientId  andStartDate:(NSString*)startdate andEndDate:(NSString*)enddate;
+(NSArray*)getClearPriceListByClientId:(NSInteger)clientId  andStartDate:(NSString*)startdate andEndDate:(NSString*)enddate;
+(NSArray*)getClearPriceListBySupplierId:(NSInteger)SupplierId  andStartDate:(NSString*)startdate andEndDate:(NSString*)enddate;
+(NSArray*)getOrderListById:(NSInteger)clientId  andStartDate:(NSString*)startdate andEndDate:(NSString*)enddate;


+(NSArray*)getOrderListByDate:(QbType)qbtype andStartDate:(NSString*)startdate andEndDate:(NSString*)enddate;
+(NSArray*)getBatchListByDate:(NSString*)startdate andEndDate:(NSString*)enddate;
+(ProductModel*)getProductByNo:(NSString*)modelNo;
+(SaleOrderModel*)getSaleOrderByNo:(NSString*)saleOrderNo;
+(void)delProductById:(NSInteger)productId;

+(void) editProductById:(NSInteger)productId andModel:(NSString *)modelNo andCategory:(CategoryModel *)category andBuyPrice:(NSString *)buyPrice andSalePrice:(NSString *)salePrice andImage:(UIImage*) image andPicPath:(NSString*)picPath andColorSizeView:(NumberFieldView *)colorSizeView;



@end
